home *** CD-ROM | disk | FTP | other *** search
- Installation of REXX/imc
-
- Summary:
-
- The REXX/imc sources, written in C, are compiled into object files and
- linked into executables. The executables may be installed into a binaries
- directory or left in the current directory. The object files will always be
- moved into the binaries directory, but may be removed after the installation
- process (the binaries directory will be chosen at compilation time, but may
- be left as "." - i.e., the current directory). After installation, the
- executables may be moved by the user, and REXX/imc may be told where to find
- these files by setting the environment variable REXXIMC - otherwise REXX/imc
- will search for these files itself.
-
- The following instructions apply mainly to SunOS, but see the notes
- following the instructions for installation on other systems.
-
- Prerequisites:
-
- Please first determine and note down the following information.
- It will be needed in the following sections.
-
- - Which compiler to use ("gcc" or Sun "cc").
-
- NOTE: The "cc" compiler is used as the linker in both cases. This is
- because our version of gcc does not appear to know about the -ldl library.
-
- - If the compiler is "gcc", determine the path name to the "gcc" command,
- and the name of the directory in which the GNU library file "libgcc.a"
- resides. The latter is needed to set the GNUDIR variable within the make
- file (current value: /usr/local/lib/gnu/gcc/sun?/2.*).
-
- - The name of a "binaries" directory. This data will be stored in the
- BINDIR environment variable, and the named directory will be used to
- store the following files:
-
- calc.o rexx.o rxfn.o shell.o types.o util.o
- [these are the object files, which may be removed after installation,
- if desired]
-
- rexx rxmathfn.rxfn rxque rxstack
- [these are the REXX/imc binaries which will be installed]
-
- rxmathfn.exec
- [this file is optional and is not required on Sun systems; the notes
- for compiling on other systems will tell you to install rxmathfn.exec]
-
- NOTE: The "Make" program will first try the BINDIR value. BINDIR may be
- left undefined if desired; in that case, "Make" will try
- $HOME/`arch`. Failing that, it will use the current directory.
-
- NOTE: When a user invokes "rexx", then the final value of REXXIMC saved
- at compile time will be used to find the other REXX/imc files when
- "rexx" is invoked by a user. However, the final location may have
- been unknown at compile-time, or the REXX/imc binaries may be
- moved at some time after compilation. In that case the user may
- optionally set REXXIMC in his environment - otherwise, REXX/imc
- will search for the files itself.
-
- NOTE: If executables came with this distribution, then /usr/local/bin is
- the name of the directory which is compiled in. Initialisation
- will be most efficient if the binaries are moved to /usr/local/bin,
- or if the user sets REXXIMC to the correct directory before
- running "rexx". This is not essential, however.
-
- The value of REXXIMC which is saved at compile time will usually be the
- name of the binaries directory (mentioned above). That will usually be
- the most convenient option. However, if you plan to move the REXX/imc
- binaries after making them and know the final location, then note down
- this location in order to set the environment variable REXXIMC before
- compilation. Then, "Make" will compile this new location into REXX/imc.
-
- Customizing the "Make" file:
-
- - Change to the directory containing the REXX/imc source files.
-
- - Copy the "Make.orig" file as "Make".
- This way you can always restart from scratch with a fresh
- copy of the "Make.orig" file.
-
- NOTE: the capital M in "Make" serves to distinguish this program from the
- Unix utility, "make". You may use any other name you choose, provided it
- does not conflict with a name that is already used. If you use the name
- "make", then you may execute it by typing "./make" instead of just "make".
-
- - Edit the file "Make" with your favorite editor.
-
- - If you will be compiling using "gcc", then: Locate the line starting
- with "GNUDIR=". Erase all text after the "=" character and type in the
- path to the GNU library on your machine. Note that the backticks and the
- word "echo" are only required when the directory contains wildcard
- characters. This step is not required when compiling using "cc".
- In many cases, you can get away by just typing ".", since "cc" already
- knows where to find the file "libgcc.a".
-
- - Locate the line starting with "CC=". If you opted to use "cc" instead of
- "gcc", then replace the whole path with "cc". Else modify the specified
- path to reflect the correct path to "gcc" itself on your machine.
-
- - If you wish to use other options for the compiler than the
- values specified in the "Make" file, locate the line with:
- *) CCFLAG=-O2;LDFLAG="-s -n -Bdynamic";;
- shortly after the line starting with "CC=", and insert your preferred
- options instead of (or as well as) the string "-O2".
-
- NOTE: you will usually need to surround the compiler flags with quotes:
- for example,
- *) CCFLAG="-O2 -Wall -v -pipe";LDFLAG="-s -n -Bdynamic";;
-
- Instead of changing this line, you may add extra compiler flags by
- altering the definition of MORECCFLAGS.
-
- - If you wish to change the linker options, then replace the string
- "-s -n -Bdynamic" in the above-mentioned line with your preferred
- options. These flags will be passed to "cc" which will, in turn, pass
- them to "ld".
-
- NOTE: The linker options are configured to create smaller executables
- (with flags -n -s -Bdynamic) for minimal use of disk space. If
- executables came with this distribution, then they might have been
- linked with more usual flags.
-
- - File the "Make" file.
-
- Creating environment variables needed when running "Make":
-
- - If your choice for the location of the REXX/imc binaries after
- compilation is other than $HOME/`arch` (or if non-existant the current
- directory), then set the environment variable BINDIR to the value you
- wish it to be.
-
- - If you are opting to move the REXX/imc binaries after compilation to a
- known final location, then set the environment variable REXXIMC to that
- value.
-
- Running the "Make" file:
-
- A more detailed description on what the "Make" file can do is written at the
- end of this file; however, the following information suffices for normal
- installation.
-
- You can choose between full or partial installation. The partial
- installation can be useful in running tests before moving the files to their
- final location.
-
- - For partial installation, simply type:
- Make
- This creates the executables, but leaves them in the current directory.
- It will, however, move the object files (that is, the six files ending
- with .o) into the binaries directory in case they are needed again later.
-
- - For full installation, type:
- Make install
- This will move the binary files as well as the object files to the
- (final) location as specified by BINDIR.
-
- NOTE: If any "Warning" options (such as "-W") are given to gcc,
- various warnings may be issued. I'm sorry!
-
- Cleanup of work files:
-
- IMPORTANT:
- If there are files in the current directory you do not want to lose, do
- NOT type this command; it will delete ALL executables and ".o" files in
- the current directory. It will also delete ALL ".o" files from the
- "binaries" directory.
-
- Type:
- Make clobber
-
- This will delete all ".o" files from the current directory and from the
- binaries directory. It will also delete (from the current directory) the
- executables rexx, rxque, rxstack and rxmathfn.rxfn, and any editor backup
- files (ending with "^" or "%") which were made from editing any of the
- following files: *.c *.h Make rexx.ref rexx.summary rexx.info rexx.tech.
- REXX/imc executables which have been installed into a binaries directory
- (other than the current directory) will not be erased.
-
- Alternatively, you may type:
- Make clean
-
- This will do the same cleanup as described above, except that it will only
- erase files which are in the current directory.
-
- Test run "rexx".
-
- Final disposition of binaries and doc files:
-
- - Move the doc files to their final location. The documentation files are
- listed in the files README and README.docs
-
- - If you opted for partial installation, then move the following
- files to their final location:
- rexx, rxque, rxstack, rxmathfn.rxfn
-
- Final notes:
-
- 1: If you have opted to let the users specify where to find the REXX/imc
- binaries, then inform them of the fact that they may optionally set the
- REXXIMC environment variable before "rexx" can be invoked.
-
- 2: Also inform the users of the location of the documentation on
- REXX/imc.
-
- Notes on compiling REXX/imc on systems other than SunOS:
-
- REXX/imc should compile OK on a Sun workstation. I have also incorporated a
- port to AIX 3.2 which was done by Ignacio Reguero <reguero@sunsoft.cern.ch>
- (for gcc) and Yossie Silverman <yossie@ucsfvm.ucsf.edu> (for cc) and had a
- report that REXX/imc can also be ported to ULTRIX 4.2. Further, I hope that
- REXX/imc may be compiled on any BSD-like platform. You may find that the
- socket libraries of System V UNIX are insufficient for, or incompatible
- with, REXX/imc in its current form. However, many System V systems do have
- extension libraries which may be sufficient. Please do try and let me know
- what happens.
-
- The macros MORECCFLAGS and LIBRARIES defined in the Make file should be
- defined to indicate the available features/requirements of your system. For
- instance, REXX/imc requires signed characters, so the -fsigned-char flag may
- be required in MORECCFLAGS. Preprocessor macros which may be defined in
- MORECCFLAGS are:
-
- NO_LDL the system does not have the functions dlopen(), dlsym(),
- dlclose(), dlerror() for dynamic loading. The effect of
- defining NO_LDL will be to remove support for external
- compiled functions.
- HAS_MALLOPT The malloc library has the function mallopt() as in SunOS
- HAS_TTYCOM The system requires <sys/ttycom.h> to be included before
- the TIOCGWINSZ ioctl can be used, as in SunOS
- NO_CNT Do not use the hack of inspecting fp->_cnt (where fp is a
- FILE pointer) to find the number of characters read but not
- returned to the program.
- STUFF_STACK Stuff surplus stacked data into the keyboard buffer before
- terminating the stack. The <sys/termios.h> file should define
- a TIOCSTI ioctl call.
-
- Possible libraries which might be required are -ldl (for the dynamic loading
- functions), -lbsd (for systems with BSD compatibility librries, as in AIX),
- -lsocket, and so on.
-
- If you define NO_LDL, you will not be able to use compiled function
- packages, such as rxmathfn.rxfn (the math library). This file should be
- removed from the binaries directory. However, it will still be possible to
- use external functions written in Rexx. You will be able to use the REXX
- math library by copying the Rexx file rxmathfn.exec into the binaries
- directory.
-
-
- The REXX/imc installation instructions were written with the kind help of
- Scott Ophof.
-
- ------------------------
-
- Make file description:
-
- The full syntax for invoking Make is:
-
- Make [letter] [targets]
-
- where "letter" is a single letter from [adgnop] and "targets" is one or more
- of the targets which are defined in the Make file. The single-letter option
- is a convenient way of altering the compilation environment without having
- to use separately customised Make files, and they are currently set up as
- follows:
-
- a uses cc with the "-a" flag to compile a version of REXX/imc which will
- output profiling statistics when executed.
- d uses the "-g" compilation flag and also defines the DEBUG preprocessor
- macro in order to make a debug version of REXX/imc with memory tracing.
- g uses the "-g" compilation flag to produce an ordinary debug version of
- REXX/imc.
- n uses no compiler flags at all, which reduces compilation time at the cost
- of making REXX/imc slightly slower.
- o uses optimisation flags to produce faster, smaller executables.
- p uses the "-p" compiler flag to compile a version of REXX/imc which will
- output profiling statistics when executed.
-
- If the single-letter option is omitted, then the flags are defined by the
- line of the Make file which starts with "*)". This is ordinarily the same
- as typing the "o" option.
-
- Note that by default "Make" will not recompile objects which have already
- been compiled, even if they were compiled with a different set of flags.
-
- The possible targets to Make are listed below. Note that unless otherwise
- stated all object files are moved to the binaries directory and all other
- files are left in the current directory.
-
- all: (same as omitting the target entirely)
- compile the executables rexx, rxstack, rxque and rxmathfn
- install: compile as for "all" and move the executables into the binaries
- directory.
- rexx: compile the "rexx" executable
- (Note that compiling the "rexx" executable implies compiling the six
- objects rexx.o, rxfn.o, calc.o, util.o, shell.o and types.o)
- rxque: compile the "rxque" executable
- rxstack: compile the "rxstack" executable
- rex: compile rexx.o
- rxfn: compile rxfn.o
- calc: compile calc.o
- util: compile util.o
- shell: compile shell.o
- math: compile the "rxmathfn.rxfn" executable
- clean: erase all "junk" files from the current directory, as described
- earlier
- clobber: erase all "junk" files from the current directory and also all
- object files from the binaries directory, as described earlier
- lint: run all the source files through "lint", accumulating the messages
- into a file (called /tmp/lint)
-
- More than one target may be named on the command line, but mixing "clean"
- and "clobber" with other options is sure to lead to surprises!
-
- ------------------------
-
- REXX/imc is copyright, but free. Permission is granted to use, copy
- and redistribute this code, provided that the same permission is
- granted to all recipients, and that due acknowledgement is given to
- the author.
-
-